$(document).ready(function() {
	$('#btnLogin').click(onLoginClick);
	if ($('#errorMessage').val() != '')
		displayErrorMessage();
});

function onLoginClick() {
	var username = $('#username').val();
	var password = $('#password').val();
	
	if (username == '') {
		alert('Username is empty. Please enter a username.');
		return false;
	}
	
	if (password == '') {
		alert('Password is empty. Please enter a password.');
		return false;
	}
}

function displayErrorMessage() {
	alert($('#errorMessage').val());
}